﻿#region Using Statements 

using System;
using System.Runtime.InteropServices;

#endregion

namespace SlimGame.Framework.Graphics
{
    [StructLayout(LayoutKind.Sequential)]
    public struct VertexPositionColorTexture
    {
        #region Fields

        private Vector3 _Position;
        private Vector4 _Color;
        private Vector2 _TexCoords;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or Sets the Position of this vertex in 3d space.
        /// </summary>
        public Vector3 Position
        {
            get { return _Position; }
            set { _Position = value; }
        }

        /// <summary>
        /// Gets or Sets the Color of this vertex in 3d space.
        /// </summary>
        public Vector4 Color
        {
            get { return _Color; }
            set { _Color = value; }
        }

        /// <summary>
        /// Gets or Sets the Texture Coordinate values of this vertex.
        /// </summary>
        public Vector2 TexCoords
        {
            get { return _TexCoords; }
            set { _TexCoords = value; }
        }

        #endregion

        /// <summary>
        /// Provides a Vertex Position to use for the Graphics Device
        /// </summary>
        /// <param name="position">The "Position" where this vertex is located in 3d space.</param>
        /// <param name="color">The "Color" value as a Vector4 for this vertex.</param>
        public VertexPositionColorTexture(Vector3 position, Vector4 color, Vector2 texCoords)
        {
            _Position = position;
            _Color = color;
            _TexCoords = texCoords;
        }

        /// <summary>
        /// Gets the Size in Bytes for this VertexPosition
        /// </summary>
        public static readonly int SizeInBytes = sizeof(float) * 9;

        /// <summary>
        /// Gets the Vertex Elements associated with this Vertex type;
        /// </summary>
        //public static readonly VertexElement[] VertexElements = 
        //{
        //    new VertexElement(0, 0, VertexElementFormat.Vector3, VertexElementMethod.Default, VertexElementUsage.Position, 0),
        //    new VertexElement(0, sizeof(float) * 3, VertexElementFormat.Vector4, VertexElementMethod.Default, VertexElementUsage.Color, 0),
        //    new VertexElement(0, sizeof(float) * 7, VertexElementFormat.Vector2, VertexElementMethod.Default, VertexElementUsage.TextureCoordinate, 0)
        //};
    }
}
